<?php
/**
 * Created by PhpStorm.
 * User: gyq
 * Date: 2018/11/4
 * Time: 13:02
 */

namespace app\api\controller\v1;

use app\api\model\Category as CategoryModel;
use app\lib\exception\CategoryException;

class Category
{
    public function getAllCategories()
    {
        $category = CategoryModel::all([],'img');
        if ($category->isEmpty()) {
            throw new CategoryException();
        }
        return $category;
    }
}